package com.ruoyi.business.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.ExperimentRecordMapper;
import com.ruoyi.business.domain.ExperimentRecord;
import com.ruoyi.business.service.IExperimentRecordService;
import com.ruoyi.common.utils.CommentUtil;

/**
 * 实验记录Service业务层处理
 * 
 * @author qiancheng
 * @date 2025-06-13
 */
@Service
public class ExperimentRecordServiceImpl extends ServiceImpl<ExperimentRecordMapper, ExperimentRecord> implements IExperimentRecordService
{
    @Autowired
    private ExperimentRecordMapper experimentRecordMapper;

    /**
     * 查询实验记录
     * 
     * @param id 实验记录主键
     * @return 实验记录
     */
    @Override
    public ExperimentRecord selectExperimentRecordById(Long id)
    {
        return experimentRecordMapper.selectExperimentRecordById(id);
    }

    /**
     * 查询实验记录列表
     * 
     * @param experimentRecord 实验记录
     * @return 实验记录
     */
    @Override
    public List<ExperimentRecord> selectExperimentRecordList(ExperimentRecord experimentRecord)
    {
        return experimentRecordMapper.selectExperimentRecordList(experimentRecord);
    }

    /**
     * 新增实验记录
     * 
     * @param experimentRecord 实验记录
     * @return 结果
     */
    @Override
    public int insertExperimentRecord(ExperimentRecord experimentRecord)
    {
        experimentRecord.setCreateTime(DateUtils.getNowDate());
        return experimentRecordMapper.insert(experimentRecord);
    }

    /**
     * 修改实验记录
     * 
     * @param experimentRecord 实验记录
     * @return 结果
     */
    @Override
    public int updateExperimentRecord(ExperimentRecord experimentRecord)
    {
        experimentRecord.setUpdateTime(DateUtils.getNowDate());
        return experimentRecordMapper.updateExperimentRecord(experimentRecord);
    }

    /**
     * 批量删除实验记录
     * 
     * @param ids 需要删除的实验记录主键
     * @return 结果
     */
    @Override
    public int deleteExperimentRecordByIds(Long[] ids)
    {
        return experimentRecordMapper.deleteExperimentRecordByIds(ids);
    }

    /**
     * 删除实验记录信息
     * 
     * @param id 实验记录主键
     * @return 结果
     */
    @Override
    public int deleteExperimentRecordById(Long id)
    {
        return experimentRecordMapper.deleteExperimentRecordById(id);
    }
}
